module.exports = function (app) {
    app.use('/register', require('./register'));
    app.use('/login', require('./login'));
    app.use('/logout', require('./logout'));
    app.use('/posts', require('./posts'));

    // 404 page
    app.use(function (req, res) {
        if (!res.headersSent) {
            res.send({error:"404 error:page not found"});
        }
    });
};
